package com.huawei.appgallery.assistantdock.base.cardkit.bean;

import android.text.TextUtils;
import com.huawei.appgallery.foundation.ui.framework.cardframe.bean.BaseCardBean;
import com.huawei.appgallery.jsonkit.api.JsonBean;
import com.huawei.hms.framework.common.ContainerUtils;
import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import o.Logger;
import o.dob;
import o.dof;

public class BuoyBaseCardBean extends BaseCardBean {
    private static final String END_FLAG = "_";
    private static final String TAG = "BuoyBaseCardBean";
    private String gSource_;
    private a listPageBtnInfo;

    public static class a {
        private boolean ˊ = false;
        private int ˋ = -1;
        private int ॱ = -1;
    }

    public String ˎ() {
        return this.gSource_;
    }

    public String u_() {
        return TextUtils.isEmpty(super.u_()) ? ـॱ() : super.u_();
    }

    public boolean ˋ(int i) {
        return false;
    }

    public String ˋ() {
        Map ॱ = ॱ();
        String[] strArr = new String[ॱ.size()];
        ॱ.keySet().toArray(strArr);
        Arrays.sort(strArr);
        StringBuilder stringBuilder = new StringBuilder();
        String str = null;
        int i = 0;
        while (true) {
            String ˊ;
            try {
                ˊ = ˊ((Field) ॱ.get(strArr[i]));
            } catch (Throwable e) {
                Logger.ˋ(TAG, "getCardId, IllegalAccessException: ", e);
                ˊ = str;
            }
            if (ˊ != null) {
                ˊ = dof.ˏ(ˊ);
                stringBuilder.append(strArr[i]).append(ContainerUtils.KEY_VALUE_DELIMITER).append(ˊ).append(ContainerUtils.FIELD_DELIMITER);
            }
            i++;
            if (i >= strArr.length) {
                return stringBuilder.toString();
            }
            str = ˊ;
        }
    }

    protected Map<String, Field> ॱ() {
        Map<String, Field> hashMap = new HashMap();
        for (Field field : dob.ˊ(getClass())) {
            field.setAccessible(true);
            String name = field.getName();
            if (name.endsWith("_")) {
                hashMap.put(name.substring(0, name.length() - "_".length()), field);
            }
        }
        return hashMap;
    }

    protected String ˊ(Field field) throws IllegalAccessException {
        Object obj = field.get(this);
        if (obj instanceof JsonBean) {
            return ((JsonBean) obj).toJson();
        }
        if (obj != null) {
            return String.valueOf(obj);
        }
        return null;
    }
}
